package top.jfunc.affect.crypto;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.jfunc.common.crypto.Crypto;
import top.jfunc.common.crypto.symmetric.AesCrypto;

/**
 * Request-Response加解密体系的加解密方式
 * @author xiongshiyan at 2018/8/14 , contact me with email yanshixiong@126.com or phone 15208384257
 */
@Configuration
public class RRCryptoConfig {
    /**
     * 加密解密方式使用一样的
     */
    @Bean("rrCrypto")
    public Crypto rrCrypto(){
        return new AesCrypto("dsfsdgwaregw");
    }

    public static void main(String[] args) {
        Crypto crypto = new AesCrypto("dsfsdgwaregw");
        System.out.println(crypto.encrypt("熊诗言"));
        System.out.println(crypto.decrypt("qBpYjdzENOoL9MVO8M+AQQ=="));
    }
}